import { createApp } from 'vue';
import * as ElementPlusIcons from '@element-plus/icons-vue';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/lib/locale/lang/zh-cn';
import App from './App.vue';
import store from './stores';
import router from './router';
import '@/router/permission';
// css
import '@/styles/tailwind.css';
import '@/styles/public.scss';

const app = createApp(App);
app.use(store);
app.use(router);
app.use(ElementPlus, { locale: zhCn });
app.mount('#app');

// 导入Element Plus图标，菜单动态图标那里，使用AutoImport插件，图标不生效！只能在这里注册所有图标后才会生效。
Object.entries(ElementPlusIcons).forEach((item: [string, any]) => {
  app.component(item[0], item[1]);
});
